<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace app\assets;

use app\services\UrlService;
use yii\web\AssetBundle;

/**
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class AppAssetDefault extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web/template/default'; //這裡是頁面渲染CSS、JS時的相對路徑
//    public $css = [
//        'css/font-awesome.min.css',
//        'css/jquery.bxslider.min.css',
//        'css/slicknav.min.css',
//        'css/all.css',
//        'css/all-mobile.css',
//    ];
//    public $js = [
//        'js/bootstrap.min.js',
//        'js/jqthumb.min.js',
//        'js/jquery.bxslider.min.js',
//        'js/jquery.slicknav.min.js',
//        'js/all.js',
//    ];
    public function registerAssetFiles($view)
    {
        $release = "20171228";
        $this->css = [
            UrlService::buildUrl("/template/default/css/font-awesome.min.css", ['v'=>$release]),
            UrlService::buildUrl("/template/default/css/jquery.bxslider.min.css", ['v'=>$release]),
            UrlService::buildUrl("/template/default/css/slicknav.min.css", ['v'=>$release]),
            UrlService::buildUrl("/template/default/css/all.css", ['v'=>$release]),
            UrlService::buildUrl("/template/default/css/all-mobile.css", ['v'=>$release]),
        ];
        $this->js = [
            UrlService::buildUrl("/template/default/js/bootstrap.min.js", ['v'=>$release]),
            UrlService::buildUrl("/template/default/js/jqthumb.min.js", ['v'=>$release]),
            UrlService::buildUrl("/template/default/js/jquery.bxslider.min.js", ['v'=>$release]),
            UrlService::buildUrl("/template/default/js/jquery.slicknav.min.js", ['v'=>$release]),
            UrlService::buildUrl("/template/default/js/all.js", ['v'=>$release]),
        ];
        parent::registerAssetFiles($view); // TODO: Change the autogenerated stub
    }

    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
    ];
}
